home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / stf.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  2.1 KB  |  81 lines

  1. #! /bin/csh
  2. #  stf is a csh script to standardize the structure of a Fortran program
  3. #  using ISTST.
  4. #    (via the combined tool fragment ISTLY = ISTLX/ISTYP and then ISTST)
  5. #
  6. #
  7. #  Invocation:
  8. #
  9. #  stf Fortran_source_file
  10. #
  11. #  Check command line validity.
  12. if ( $#argv < 1 ) then
  13. TOOLPACKPATH/toolpack1.2/util/echoerr \
  14. Invocation:
  15. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  16. TOOLPACKPATH/toolpack1.2/util/echoerr \
  17. stf Fortran_source_file
  18. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  19. TOOLPACKPATH/toolpack1.2/util/echoerr \
  20. Structured code is sent to standard output and may be redirected to a file.
  21. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  22.    exit
  23. endif
  24. #  Check that Fortran_source_file exists.
  25. if ( -e $1 == 0 ) then
  26. TOOLPACKPATH/toolpack1.2/util/echoerr \
  27. "'$1' does not exist."
  28.    exit
  29. endif
  30. #
  31. #  Create PFS.  If PFS already exists, exit with an advisory message.
  32. #
  33. if ( -e _.TOOLPACK == 0 ) then
  34.    mkdir _.TOOLPACK
  35. else
  36. TOOLPACKPATH/toolpack1.2/util/echoerr \
  37. Toolpack-created directory '"_.TOOLPACK"' exists. \
  38. Remove with script '"discard"'.
  39.    exit
  40. endif
  41. #  Make a tab-free copy of the Fortran source and use it as source.
  42. set src = ly.src$$
  43. expand $1 > _.TOOLPACK/$src
  44. #  Comment file name.
  45. set cmt = _.lycmt
  46. #  Parse tree file name.
  47. set tree = _.lytree
  48. #  Symbol table file name.
  49. set symb = _.ypsymb
  50. #  Comment index file name.
  51. set indx = _.lyindx
  52. #  Create the interprocess file IST.CMD and append parameters for ISTLY.
  53. TOOLPACKPATH/toolpack1.2/util/mkipf \
  54. $src $cmt $tree $symb $indx
  55. #
  56. #  Invoke ISTLY.
  57. #
  58. TOOLPACKPATH/toolpack1.2/exec/istly.u
  59. #
  60. #  If tool terminated with errors, advise user to obtain listing.  Exit.
  61. if ( `cat _.TOOLPACK/_.info` == -1 ) then
  62. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  63. TOOLPACKPATH/toolpack1.2/util/echoerr \
  64. 'Errors detected.  Invoke script "getlst" to obtain a listing showing'
  65. TOOLPACKPATH/toolpack1.2/util/echoerr \
  66. statement and token numbers.
  67. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  68.    /bin/rm -r _.TOOLPACK
  69.    exit
  70. endif
  71. #  Create the interprocess file IST.CMD and append parameters for ISTST.
  72. TOOLPACKPATH/toolpack1.2/util/mkipf \
  73. $tree $symb $indx $cmt \#1 -
  74. #
  75. #  Invoke ISTST.
  76. #
  77. TOOLPACKPATH/toolpack1.2/exec/istst.u
  78. #
  79. /bin/rm -r _.TOOLPACK
  80. #
  81.